home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-09-17 | 7.2 KB | 238 lines | [TEXT/MPS ] |
- (*+
- * File: UVUAssist.p
- *
- * Contains: VU Assistance class
- *
- * Written by: David Shayer
- *
- * Copyright: © 1991 by Apple Computer, Inc., all rights reserved.
- *
- * Version: 1.0d10
- *
- * 8/29/91 JAS add prototype for MyWMgrToWindow, bump version to 1.0d10
- * 8/21/91 JAS change version
- * 8/19/91 JAS eliminate comments which are already in READ ME FIRST! file
- * 8/19/91 JAS rev comments and change case of GridItemSupport to
- * gridItemSupport
- * 8/15/91 JAS add fGridItemSupport data member to TVUAssist and change
- * prototype of IVUAssist to take GridItemSupport as input
- * 8/13/91 JAS include gridItem parameter in FillDlogItemDesc and RankToItem
- * 8/13/91 JAS make TGridItem direct descendant of TObject instead of
- * TGridView
- * 8/6/91 JAS remove TVUAssist.DoFindWindowInfo (not needed)
- -*)
-
-
- {Historical Note: References to the "Mole" are equivalent to references to "Agent VU".
- "Agent VU" was previously called the "Mole".}
-
- (*
-
- So you wanna use V.U. to test your MacApp program? You need to help Agent VU find things
- in your windows, since MacApp views appear empty to Agent VU. Fortunately, Agent VU has a
- hook for an assistance procedure. The assistance procedure is a routine, in the application
- being manipulated by V.U., that feeds Agent VU inside information about what's in the
- views. This unit implements that assistance routine.
-
- This unit contains 4 files: VUAssist.p, VUAssist.inc1.p, VUAssist.inc2.p,
- and VUAssist.a.
-
- See the "READ ME FIRST!" file for instructions on how to use VUAssist and other information.
-
- *)
-
-
- UNIT UVUAssist;
-
- INTERFACE
-
- USES
-
- { • MacApp }
- UMacApp,
- {$IFC qDebug}
- UDebug,
- {$ENDC}
-
- { • Building Blocks }
- UPrinting, UTEView, UDialog, UGridView,
-
- { • System Interfaces }
- Errors,
- Resources,
- AppleTalk, ToolUtils,
- OSEvents,
- Packages,
- Script,
- Desk;
-
- {$I UVUAssist.inc1.p}
-
- TYPE
-
- { There is a another definition of this object in UVUAssist.a, which is
- a subset of this definition. If you update this definition, be sure to
- update the one in UVUAssist.a, if necessary. }
- TVUAssist = OBJECT (TEvtHandler)
-
- fMoleRefNum :integer;
-
- fGridItemSupport :boolean;
-
- PROCEDURE TVUAssist.IVUAssist(gridItemSupport: boolean);
-
- PROCEDURE TVUAssist.OpenMoleDriver;
-
- PROCEDURE TVUAssist.SuspendMole;
-
- PROCEDURE TVUAssist.ResumeMole;
-
- PROCEDURE TVUAssist.SetDebuggerHook (NewHook :ProcPtr);
-
- FUNCTION TVUAssist.MoleAssist (Select :integer; Input :Ptr; Output :Ptr;
- VAR OutputSize :integer; IntResult :integer) :integer;
-
- FUNCTION TVUAssist.DoMenuInfo (Input :Ptr; Output :Ptr; VAR OutputSize :integer;
- Result :MoleError) :MoleError;
-
- FUNCTION TVUAssist.DoMenuItems (Input :Ptr; Output :Ptr; VAR OutputSize :integer;
- Result :MoleError) :MoleError;
-
- FUNCTION TVUAssist.DoSendWindowInfo (Input :Ptr; Output :Ptr;
- VAR OutputSize :integer; Result :MoleError) :MoleError;
-
- FUNCTION TVUAssist.DoFindControl (Input :Ptr; Output :Ptr;
- VAR OutputSize :integer; Result :MoleError) :MoleError;
-
- FUNCTION TVUAssist.DoSendControlInfo (Input :Ptr; Output :Ptr;
- VAR OutputSize :integer; Result :MoleError) :MoleError;
-
- FUNCTION TVUAssist.DoSendDlogItemInfo (Input :Ptr; Output :Ptr;
- VAR OutputSize :integer; Result :MoleError) :MoleError;
-
- PROCEDURE TVUAssist.FillPopupDesc (Popup: TPopup; MenuRank: integer;
- MenuDescPtr :MoleMenuInfoPtr; VAR OutputSize :integer);
-
- FUNCTION TVUAssist.FillPopupItemDesc (Popup: TPopup; MenuRank: integer;
- start: integer; stop: integer; MenuItemDescPtr :MoleDataBlockPtr;
- VAR OutputSize :integer) :MoleError;
-
- FUNCTION TVUAssist.FillCtrlDesc (CtrlDescPtr :MoleCDescPtr; thePart :integer;
- WindRank :integer; ControlRank :integer; Control :TControl;
- VAR OutputSize :integer): Boolean;
-
- PROCEDURE TVUAssist.ViewRectToWindowRect (VAR aRect :Rect; aView :TView);
-
- PROCEDURE TVUAssist.FillDlogItemDesc (DlogDescPtr :MoleDItemInfoPtr;
- Window :TWindow; WindRank :integer; ItemRank :integer; Item :TView;
- VAR OutputSize :integer; gridItem :TGridItem );
-
- FUNCTION TVUAssist.MyWMgrToWindow(wMgrWindow: WindowPtr) :TWindow;
-
- FUNCTION TVUAssist.RankToWindow (Rank :integer) :TWindow;
-
- FUNCTION TVUAssist.WindowToRank (WindToFind :WindowPeek) :integer;
-
- PROCEDURE TVUAssist.GlobalToWindow (Window :TWindow; Pt :Point; VAR VPt :VPoint);
-
- PROCEDURE TVUAssist.WindowToView (View :TView; VAR VPt :VPoint; VAR Pt :Point);
-
- FUNCTION TVUAssist.MenuIDToPopup (MenuID :integer) :TPopup;
-
- FUNCTION TVUAssist.PointToControl (Window :TWindow; Pt :Point;
- VAR Rank :integer) :TCtlMgr;
-
- FUNCTION TVUAssist.ItemToRank (Window :TWindow; View :TView;
- DlogViewItems :Boolean) :integer;
-
- FUNCTION TVUAssist.RankToItem (Window :TWindow; Rank :integer;
- DlogViewItems :Boolean; VAR gridItem: TGridItem ) :TView;
-
- FUNCTION TVUAssist.ViewCount (Window :TWindow; DlogViewItems :Boolean) :integer;
-
- FUNCTION TVUAssist.CountGridItems (theGridView: TGridView): integer;
-
- FUNCTION TVUAssist.GetItemType (Item :TView; DlogViewItems :Boolean;
- GridViewItems: Boolean) :ViewItems;
-
- {$IFC qDebug}
-
- PROCEDURE TVUAssist.PrintFindWindReq (WindReqPtr :SendFindWindowParamPtr);
-
- PROCEDURE TVUAssist.PrintWindReq (WindReqPtr :DWindReqPtr);
-
- PROCEDURE TVUAssist.PrintWindDesc (WindDescPtr :MoleWDescPtr);
-
- PROCEDURE TVUAssist.PrintCtrlReq (CtrlReqPtr :SendCtlInfoParamsPtr);
-
- PROCEDURE TVUAssist.PrintCtrlPoint (CtrlReqPtr :SendFindControlParamPtr);
-
- PROCEDURE TVUAssist.PrintCtrlDesc (CtrlDescPtr :MoleCDescPtr);
-
- PROCEDURE TVUAssist.PrintDlogReq (DlogReqPtr :SendDItemInfoPtr);
-
- PROCEDURE TVUAssist.PrintDlogDesc (DlogDescPtr :MoleDItemInfoPtr);
-
- PROCEDURE TVUAssist.PrintMenuInfoReq (MenuReqPtr :SendMenuInfoParamsPtr);
-
- PROCEDURE TVUAssist.PrintMenuInfoDesc (MenuDescPtr :MoleMenuInfoPtr);
-
- PROCEDURE TVUAssist.PrintMenuItemReq (MenuReqPtr :SendMenuItemsParamsPtr);
-
- PROCEDURE TVUAssist.PrintMenuItemDesc (MenuDescPtr :MoleDataBlockPtr;
- OutputSize :integer);
-
- PROCEDURE TVUAssist.Fields(PROCEDURE DoToField(fieldName: Str255;
- fieldAddr: Ptr; fieldType: INTEGER)); OVERRIDE;
-
- {$ENDC}
-
- END;
-
-
- TGridItem = OBJECT (TObject)
-
- fGridView: TGridView; { reference to a TGridView object}
-
- fColumn: longint; { 1 based counter }
-
- fRow: longint; { 1 based counter }
-
- fRank: longint; { (row-1) * rowlength + column }
-
- PROCEDURE TGridItem.IGridItem(theGridView: TGridView; Rank: integer);
-
- PROCEDURE TGridItem.GetExtent(VAR itsExtent: VRect);
-
- PROCEDURE TGridItem.LocalToWindow(VAR thePoint: VPoint);
-
- {$IFC qDebug}
-
- PROCEDURE TGridItem.PrintInstanceVars;
-
- PROCEDURE TGridItem.Fields(PROCEDURE DoToField(fieldName: Str255;
- fieldAddr: Ptr; fieldType: INTEGER)); OVERRIDE;
- {$ENDC}
-
- END;
-
-
-
- VAR
- gVUAssist : TVUAssist; { the mole assist proc }
-
- {$IFC qDebug}
-
- gVUDebug : Boolean; { debug mode is on }
-
- {$ENDC}
-
-
-
- IMPLEMENTATION
-
- {$I UVUAssist.inc2.p}
-
-
- END.
-